<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="UTF-8">
  <title>08_形参默认值</title>
</head>
<body>
<!--
  * 形参的默认值----当不传入参数的时候默认使用形参里的默认值
  function Point(x = 1,y = 2) {
    this.x = x;
    this.y = y;
  }
-->
<script type="text/javascript">
  // 定义一个点的坐标
  function Point(x = 12, y = 12) {
    this.x = x;
    this.y = y;
  }

  let point = new Point(25, 36);
  console.log(point);
  let p = new Point();
  console.log(p);
  let point1 = new Point(12, 35);
  console.log(point1);
</script>
</body>
</html>
